package com.huarui.companyconfig.action;

import java.util.HashMap;
import java.util.Map;

import org.ewaf.framework.action.BaseAction;

import com.huarui.companyconfig.service.CompanyConfigService;
import com.huarui.user.model.SessionMessage;
import com.huarui.user.security.UserHolder;
import com.huarui.util.JsonUtil;



@SuppressWarnings("serial")
public class CompanyConfigAction extends BaseAction {
	private CompanyConfigService companyConfigService;
	private String coefficient;
	private Map<String,Object> resultMap=new HashMap<String,Object>();
	public String extList(){
		SessionMessage sm=UserHolder.getCurrentSessionMessage();
		resultMap.put("root", companyConfigService.getListByCompanyId(sm.getCompanyId()));
		return SUCCESS;
	}
	@SuppressWarnings("unchecked")
	public String save(){
		Map map=JsonUtil.getBean(coefficient, HashMap.class);
		resultMap=companyConfigService.batchUpdate(map);
		return SUCCESS;
	}
	public Map<String, Object> getResultMap() {
		return resultMap;
	}
	public void setCompanyConfigService(CompanyConfigService companyConfigService) {
		this.companyConfigService = companyConfigService;
	}
	public void setCoefficient(String coefficient) {
		this.coefficient = coefficient;
	}
	
}
